{% extends 'new-layout/layout.html' %}
{% import 'libs/libs.html' as libs %}
{% import 'libs/const.html' as const %}

{% block title_nav %}
<li><a href="/user/">用户管理</a></li>
{% endblock %}

{% block search_body %}
{% 
    set form_config = [
        {'label':'uid', 'name':'uid',},
        {'label':'手机号码', 'name':'mobile', },
        {'label':'真实姓名', 'name':'realname'},
        {'label':'老师申请状态', 'name':'teacher_status', 'type':'select', 'options':[
                {'name':'请选择……', 'value':'0'},
                {'name':'待审核', 'value':'1'},
                {'name':'审核通过', 'value':'2'},
                {'name':'拒绝通过', 'value':'3'}]},


    ] 
%}
{{ libs.build_search_form(form_config) }}

{% endblock %}

{% block data_body %}
<div class="table-responsive">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>uid</th>
                <th>注册时间</th>
                <th>头像</th>
                <th>手机号码</th>
                <th>真实姓名</th>
                <th>妮称</th>
                <th>性别</th>
                <th>出生年</th>
                <th>实名认证</th>
                <th>资格认证</th>
            </tr>
        </thead>
        <tbody>
        {% for user in user_list %}
            <tr>
                <td><a href="{{ url_for('user.detail', uid=user.uid) }}">{{ user.uid }}</a></td>
                <td>{{ user.regtime|format_timestamp }}</td>
                <td><img src="{{ user.avatar_small }}" style="width:50px;"></td>
                <td>{{ user.mobile }}</td>
                <td>{{ user.realname }}</td>
                <td>{{ user.nickname }}</td>
                <td>{{ const.GENDER.get(user.gender, 0) }}</td>
                <td>{{ user.birth_year }}</td>
                <td>{{ const.YES_OR_NO.get(user.is_real, 0)|safe }}</td>
                <td>{{ const.YES_OR_NO.get(user.is_cert, 0)|safe }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {{ libs.pagination_html(pagination) }}

</div>
{% endblock %}
